FIG. 1A illustrates, in a highly simplified form, a machine vision system 100. The machine vision system 100 can be used to read and decode an optically readable symbol such as bar code 104. A typical bar code is made up of a series of alternating black (dark) or white (light) elements or bars of various widths. The basic elements of the machine vision system 100 are a focusing element 102 and an image sensor 106. In operation of the vision system 100, an optically readable symbol such as a barcode 104 is first positioned in the field of view of the focusing element 102. The focusing element 102 then focuses an image of the barcode 104 onto the image sensor 106. The digital image 105 of the barcode captured by the sensor 106 is then analyzed by other components (not shown) to determine the information encoded in the bar code 104.
FIG. 1B illustrates a phenomenon that occurs with high-density bar codes—that is, bar codes where the widths of the individual light and dark bars begin to get small. As the individual light and dark bars of the barcode become narrower, the widths of the individual light and dark elements in the image captured by the sensor 106 get narrower as well. Eventually, the widths XW of the narrowest light bars and the widths XB of the narrowest dark bars start to be of the same order of magnitude as the widths of individual pixels on the sensor 106. All is well if the images of the black and white bars substantially coincide with the pixels. Black bar 109, for example, is substantially aligned with a pixel on the sensor, and the sensor accurately records that pixel as a “dark” pixel. Similarly, white bar 111 is substantially aligned with a pixel, and the sensor accurately records that pixel as a “light” pixel. Black bar 112, however, is different: it is not aligned with a pixel, but instead spans parts of two pixels. Faced with this situation where each of two pixels is partially spanned by a black bar 112, such that each pixel is half black and half white, the sensor records a two-pixel “gray” area 114. Pixel misalignment of multiple bars can lead to larger gray areas such as three-pixel gray area 116, which results from bar 108 overlapping part of one pixel and bar 110 spanning parts of two pixels. With high-density bar codes, other phenomena besides misalignment can also result in gray pixels. For example, a string of one or more gray pixels might result if one or more of the bars in the image 105 are of non-uniform width, which can result from poor printing of the bar code 104, damage to the barcode 104, or the like.
Decoders that extract information encoded in the barcode 104 have two tasks. First, based on the image captured by the sensor 106—that is, based on the intensities of the pixels in the image—they must re-construct the sequence of black and white bars on the original bar code 104. Having correctly re-constructed the original sequence of the bar code, they then analyze the sequence to extract the encoded information. Available decoders, however, are usually programmed to deal only with image pixels that are either dark or light. Faced with strings of gray pixels, available decoders may not be able to determine the sequence of bars that created the gray areas and may therefore fail to properly decode a symbol. There is thus a need for an apparatus and method for accurately decoding high-density bar codes.